﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace legends
{
    public partial class SettingsForm : Form
    {
        private MenuForm parentForm;
        public SettingsForm(MenuForm menuForm)
        {
            InitializeComponent();
            parentForm = menuForm;
            
            //
            // Initialization of texts in Comboboxes
            //		
            Screen Srn = Screen.PrimaryScreen;
            int tempWidth = Srn.Bounds.Width;
            int tempHeight = Srn.Bounds.Height;

            this.ResolutionComboBox.Text = tempWidth.ToString() + " x " + tempHeight.ToString();
            this.DifficultyComboBox.Text = parentForm.gameConstants.getDifficulty();

            
        }
        
        private void OKButton_Click(object sender, EventArgs e)
        {
            this.Dispose();
            //
            // Changes resolution and difficulty for @GameConstants variable according to Comboboxes
            //		
            switch (ResolutionComboBox.SelectedIndex)
            {
                case 0: parentForm.gameConstants.setRes(1920, 1080); break;
                case 1: parentForm.gameConstants.setRes(1680, 1050); break;
            }
            switch (DifficultyComboBox.SelectedIndex)
            {
                case 0: parentForm.gameConstants.setDifficulty("Easy"); break;
                case 1: parentForm.gameConstants.setDifficulty("Medium"); break;
                case 2: parentForm.gameConstants.setDifficulty("Hard"); break;
                case 3: parentForm.gameConstants.setDifficulty("Insane"); break;
                case 4: parentForm.gameConstants.setDifficulty("Only for Chase"); break;
            }
        }

        private void CancelButton_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void button1_Click(object sender, EventArgs e)
        {
         //   button1.Text = ResolutionComboBox.;
        }
    }
}
